
public class Student {
    private String name;//姓名
     int age;//年龄
    private String sex;//性别
    private static String classroom="高三四班";//教室

    public static String getClassroom() {
        return classroom;
    }
    public void print() {
        System.out.println(name+" "+age+" "+sex+" "+classroom);
    }
    public static void setClassroom(String classroom) {
        Student.classroom = classroom;
//        System.out.println(name);
//        System.out.println(age);
//        print();
    }
}
class Main {

    public static void main(String[] args) {
        Student.setClassroom("高三四班");
        Student student=new Student();
        //非静态成员变量。刚才已经修改了age权限所以现在可以用
        student.age=10;
        //非静态成员方法
        student.print();
    }
}